草庐IT

Beautiful Soup

全部标签

python - 初学者学习 Python 屏幕抓取的最佳方式

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭去年。Improvethisquestion这可能是难以回答的问题之一,但这里是:我不认为自己是程序员——但我想:-)我学过R,因为我厌倦了spss,而且因为friend向我介绍了这门语言——所以我不是对编程逻辑完全陌生。现在我想学习python-主要是做屏幕抓取和文本分析,但也用于使用Pylons或Django编写web应用程序。那么:我应该如何开始学习使用python进行屏幕抓取?我开始浏览scrappydocs但我觉得有很多“魔

python - 初学者学习 Python 屏幕抓取的最佳方式

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭去年。Improvethisquestion这可能是难以回答的问题之一,但这里是:我不认为自己是程序员——但我想:-)我学过R,因为我厌倦了spss,而且因为friend向我介绍了这门语言——所以我不是对编程逻辑完全陌生。现在我想学习python-主要是做屏幕抓取和文本分析,但也用于使用Pylons或Django编写web应用程序。那么:我应该如何开始学习使用python进行屏幕抓取?我开始浏览scrappydocs但我觉得有很多“魔

python - 安装包 Beautiful Soup 失败。错误消息是 "SyntaxError: Missing parentheses in call to ' print'"

我已经在我的Windows8计算机上安装了Python3.5。我还安装了Pycharm社区版本5.0.4。我无法通过Pycharm中的设置选项安装BeautifulSoup模块。我在Pycharm中收到以下错误:CollectingBeautifulSoupUsingcachedBeautifulSoup-3.2.1.tar.gzCompleteoutputfromcommandpythonsetup.pyegg_info:Traceback(mostrecentcalllast):File"",line1,inFile"C:\Users\Kashyap\AppData\Local\T

python - 安装包 Beautiful Soup 失败。错误消息是 "SyntaxError: Missing parentheses in call to ' print'"

我已经在我的Windows8计算机上安装了Python3.5。我还安装了Pycharm社区版本5.0.4。我无法通过Pycharm中的设置选项安装BeautifulSoup模块。我在Pycharm中收到以下错误:CollectingBeautifulSoupUsingcachedBeautifulSoup-3.2.1.tar.gzCompleteoutputfromcommandpythonsetup.pyegg_info:Traceback(mostrecentcalllast):File"",line1,inFile"C:\Users\Kashyap\AppData\Local\T

javascript - 用于网页抓取的 Selenium 与 BeautifulSoup

我正在使用Python从网站上抓取内容。首先,我在Python上使用了BeautifulSoup和Mechanize,但我看到该网站有一个通过JavaScript创建内容的按钮,所以我决定使用Selenium。鉴于我可以使用Selenium和driver.find_element_by_xpath等方法找到元素并获取它们的内容,当我可以使用Selenium时,有什么理由使用BeautifulSoup一切?在这种特殊情况下,我需要使用Selenium来单击JavaScript按钮,那么使用Selenium进行解析更好还是应该同时使用Selenium和BeautifulSoup?

javascript - 用于网页抓取的 Selenium 与 BeautifulSoup

我正在使用Python从网站上抓取内容。首先,我在Python上使用了BeautifulSoup和Mechanize,但我看到该网站有一个通过JavaScript创建内容的按钮,所以我决定使用Selenium。鉴于我可以使用Selenium和driver.find_element_by_xpath等方法找到元素并获取它们的内容,当我可以使用Selenium时,有什么理由使用BeautifulSoup一切?在这种特殊情况下,我需要使用Selenium来单击JavaScript按钮,那么使用Selenium进行解析更好还是应该同时使用Selenium和BeautifulSoup?

python - 使用 Python 将 html 转换为文本

我正在尝试使用Python将htmlblock转换为文本。输入:Loremipsumdolorsitamet,consectetueradipiscingelit.Aeneancommodoligulaegetdolor.AeneanmassaConsectetueradipiscingelit.SomeLinkAeneancommodoligulaegetdolor.AeneanmassaAeneanmassa.Loremipsumdolorsitamet,consectetueradipiscingelit.Aeneancommodoligulaegetdolor.Aeneanma

python - 使用 Python 将 html 转换为文本

我正在尝试使用Python将htmlblock转换为文本。输入:Loremipsumdolorsitamet,consectetueradipiscingelit.Aeneancommodoligulaegetdolor.AeneanmassaConsectetueradipiscingelit.SomeLinkAeneancommodoligulaegetdolor.AeneanmassaAeneanmassa.Loremipsumdolorsitamet,consectetueradipiscingelit.Aeneancommodoligulaegetdolor.Aeneanma

Python BeautifulSoup 给 findAll 多个标签

我正在寻找一种方法来使用findAll来获取两个标签,按照它们在页面上出现的顺序。目前我有:importrequestsimportBeautifulSoupdefget_soup(url):request=requests.get(url)page=request.textsoup=BeautifulSoup(page)get_tags=soup.findAll('hr'and'strong')foreachinget_tags:printeach如果我在只有“em”或“strong”的页面上使用它,那么它会得到所有这些标签,如果我在一个页面上同时使用它会得到“strong”标签。有

Python BeautifulSoup 给 findAll 多个标签

我正在寻找一种方法来使用findAll来获取两个标签,按照它们在页面上出现的顺序。目前我有:importrequestsimportBeautifulSoupdefget_soup(url):request=requests.get(url)page=request.textsoup=BeautifulSoup(page)get_tags=soup.findAll('hr'and'strong')foreachinget_tags:printeach如果我在只有“em”或“strong”的页面上使用它,那么它会得到所有这些标签,如果我在一个页面上同时使用它会得到“strong”标签。有